//
//  DaishouBatchCell.m
//  TengyunStation
//
//  Created by Johnny on 15/10/23.
//  Copyright © 2015年 xingrong. All rights reserved.
//

#import "DaishouBatchCell.h"
#import "TSHeader.h"
#import "UIImageView+WebCache.h"
#import "Daishou.h"

@implementation DaishouBatchCell

- (void)awakeFromNib {
    // Initialization code
    UILabel *line = [[UILabel alloc] initWithFrame:CGRectMake(0, 63.5, 320, 0.5)];
    line.backgroundColor = LineColor;
    [self addSubview:line];
    _logoImageView.layer.cornerRadius = 2;
    _logoImageView.clipsToBounds = YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)reloadDaishouBatchCell:(Daishou *)daishou {
    NSString *companyUrl = [daishou.companyLogo stringByReplacingOccurrencesOfString:@"\\" withString:@"/"];
    NSURL *logoUrl = [NSURL URLWithString:companyUrl];
    [_logoImageView sd_setImageWithURL:logoUrl placeholderImage:[UIImage imageNamed:@"yijskd_logo_bg"]];
    if (daishou.handleType == 1) {
        _expressCompanyLabel.text = daishou.companyName;
        _countLabel.text = [NSString stringWithFormat:@"待接收快件:%d",daishou.expressCount];
    } else if (daishou.handleType == 2) {
        _expressCompanyLabel.text = daishou.companyName;
        _countLabel.text = [NSString stringWithFormat:@"已接收快件:%d",daishou.expressCount];
    } else if (daishou.handleType == 3) {
        _expressCompanyLabel.text = [NSString stringWithFormat:@"%@(已拒收)",daishou.companyName];
        _countLabel.text = [NSString stringWithFormat:@"已拒收快件:%d",daishou.expressCount];
    }
    _timeLabel.text = [NSString stringWithFormat:@"%@ %@",daishou.showDay,daishou.showTime];
}

@end
